perf(bench): add @cipherstash/bench for index-engagement validation#424
perf(bench): add @cipherstash/bench for index-engagement validation#424
Conversation
|
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (16)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
44a68f4 to
4f130bb
Compare
Adds a new private workspace package that runs encrypted query forms through EXPLAIN against a 10k-row fixture, asserting that each integration's emitted SQL engages the canonical EQL functional indexes (hmac_256 / bloom_filter / ste_vec) instead of falling back to seq scan. Drizzle adapter is in; encryptedSupabase and Prisma scaffold to follow. Two layers: - __tests__/ — vitest assertions on plan shape (cheap, CI-runnable). - __benches__/ — vitest --bench timings (on-demand). The drizzle/operators.explain.test.ts file currently fails on eq / inArray — that's the pre-fix repro for the bare-equality bug. The fix follows in a stacked branch.
4f130bb to
0ab1d66
Compare
auxesis
left a comment
There was a problem hiding this comment.
@coderdan this is great work expanding test coverage, thank you.
Approved with one comment about incorrect docs.
One other thing to note:
- None of these tests will run in in CI when there are changes made to them.
- This is by design, because 2/15 tests are currently failing, and that will stop PRs from being merged
- I'll put up a follow up PR to add CI, and will rebase it once the fixes are made in the PRs your working on.
Yes, that's correct. I plan to enable in CI once the issues have been resolved.
Ok thanks. |
Summary
Adds a new private workspace package
@cipherstash/benchthat runs encrypted query forms throughEXPLAIN (ANALYZE, BUFFERS, FORMAT JSON)against a 10k-row fixture and asserts on plan shape — does the integration's emitted SQL engage the canonical EQL functional indexes (eql_v2.hmac_256,eql_v2.bloom_filter,eql_v2.ste_vec), or does it fall back to seq scan?Surfaces #421 (and informs #422 / #423) on real data instead of unit-test mocks.
Drizzle adapter is wired up;
encryptedSupabaseand Prisma scaffold to follow.Layout
Layers
__tests__/) — vitest assertions on plan shape. Cheap, deterministic, intended for CI.__benches__/) — vitest--bench(tinybench) for median / p95 latency. On-demand.Run
Status on this branch
The bench currently fails on
eqandinArray— that's the pre-fix repro for the bare-equality bug. The fix is stacked on top in a separate PR.#422operators (like / ilike / gt / between / order_by / jsonb_*) all currently seq-scan; the bench captures the plan shape intoresults/explain-shape.jsonfor the investigation but does not assert.Test plan
pnpm installat repo rootcd local && docker compose up -dcd packages/bench && pnpm test -- db-onlypasses 4/4pnpm db:setupseeds 10k rows (needsstash login)pnpm testruns the full EXPLAIN suite (will be partially red until the stacked fix lands)Example run from #425